FROM centos:centos6

MAINTAINER sunyongjun <1289263571@qq.com>

RUN yum update -y
RUN yum -y install gcc gcc-c++ autoconf  zlib zlib-devel glibc glibc-devel glib2 glib2-devel l curl curl-devel ssh tar wget


#set java env
ENV JAVA_VERSION=1.8.0_45
ENV JAVA_TARBALL=server-jre-8u45-linux-x64.tar.gz
ENV JAVA_HOME=/opt/java/jdk${JAVA_VERSION}

#download
RUN wget --no-check-certificate --directory-prefix=/tmp \
         --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
         http://download.oracle.com/otn-pub/java/jdk/8u45-b14/${JAVA_TARBALL} && \
    mkdir -p /opt/java && \
    tar -xzf /tmp/${JAVA_TARBALL} -C /opt/java/ && \
    alternatives --install /usr/bin/java java /opt/java/jdk${JAVA_VERSION}/bin/java 100 && \
    rm -rf /tmp/* && rm -rf /var/log/*
    
RUN wget http://download.eclipse.org/jetty/9.2.12.v20150709/dist/jetty-distribution-9.2.12.v20150709.tar.gz

RUN yum clean all && rm -rf /var/cache/yum/*

RUN tar zxvf jetty-distribution-9.2.12.v20150709.tar.gz -C /opt/
RUN mv /opt/jetty-distribution-9.2.12.v20150709/ /opt/jetty
CMD /opt/jetty/bin/jetty.sh start && /usr/sbin/sshd -D